package com.lankystar.sos.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lankystar.sos.dao.IStatusDao;
import com.lankystar.sos.model.AuthStatus;
import com.lankystar.sos.model.ResponseStatus;
import com.lankystar.sos.model.SosStatus;
import com.lankystar.sos.model.UserType;
import com.lankystar.sos.service.IStatusInterface;

@Service
@Transactional
public class StatusInterface implements IStatusInterface{

	@Autowired
	private IStatusDao statusDao;
	@Override
	public void addUserTypeMethod(UserType record) {
		this.statusDao.addUserType(record);
	}
	@Override
	public void deleteUserTypeMethod(Integer userTypeId) {
		UserType userType = statusDao.selectUserTypeById(userTypeId);
		if(userType!=null){
			this.statusDao.deleteUserType(userType);
		}
		
	}
	@Override
	public void addSosStatusMethod(SosStatus record) {
		this.statusDao.addSosStatus(record);
	}
	@Override
	public void deleteSosStatusMethod(Integer sosStatusId) {
		SosStatus sosStatus = statusDao.selectSosStatusById(sosStatusId);
		if(sosStatus!=null){
			this.statusDao.deleteSosStatus(sosStatus);
		}
		
	}
	@Override
	public void addRespStatusMethod(ResponseStatus record) {
		this.statusDao.addRespStatus(record);
	}
	@Override
	public void deleteRespStatusMethod(Integer respStatusId) {
		ResponseStatus respStatus = statusDao.selectRespStatusById(respStatusId);
		if(respStatus!=null){
			this.statusDao.deleteRespStatus(respStatus);
		}
		
	}
	@Override
	public void addAuthStatusMethod(AuthStatus record) {
		this.statusDao.addAuthStatus(record);
	}
	@Override
	public void deleteAuthStatusMethod(Integer authStatusId) {
		AuthStatus authStatus = statusDao.selectAuthStatusById(authStatusId);
		if(authStatus!=null){
			this.statusDao.deleteAuthStatus(authStatus);
		}
		
	}

	
}
